package com.zhonglian.education.common.download;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

import com.zhonglian.education.R;

/**
 * Created : Yx
 * Time : 2019/5/15 14:49
 * Describe :下载弹窗
 */
public class DownloadCircleDialog extends Dialog {
    public DownloadCircleDialog(Context context) {
        super(context, R.style.Theme_Ios_Dialog);
    }

    private DownloadCircleView circleView;
    private TextView tvMsg;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.download_circle_dialog_layout);
        this.setCancelable(false);//设置点击弹出框外部，无法取消对话框
        circleView = findViewById(R.id.circle_view);
        tvMsg = findViewById(R.id.tv_msg);
    }


    public void setProgress(int progress) {
        circleView.setProgress(progress);
        circleView.postInvalidate();
    }

    public void setMsg(String msg) {
        tvMsg.setText(msg);
    }
}